const Sequelize = require('sequelize')
const {
    dbName,
    host,
    port,
    user,
    password
} = require('../uilt/config').database

const sequelize = new Sequelize(dbName, user, password, {
    dialect: 'mysql',
    host,
    port,
    logging: false, // 打印原始sql
    timezone: '+08:00', // +8小时才是北京时间
    define: {
        timestamps: false,
        paranoid: false
    }
})

sequelize.sync({
    force: false // 是否这将先丢弃表,然后重新创建它
})

module.exports = {
    sequelize
}
